package com.xzlzx.springbootgroovy.entity

import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Query

interface Repo extends JpaRepository<TestBean, Long> {

    @Query(value = "select * from t_1 where name=?", nativeQuery = true)
    List<TestBean> queryByNameUseSQL(String name)

    @Query(value = """select * from t_1 
                    left join t_2 on t_1.id = t_2.fid
                    where t_2.name=?""", nativeQuery = true)
    List<TestBean> joinUseSQL(String name)
}
